package com.ct.ioc.config;

import com.ct.ioc.model.UserInfo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@Configuration
public class UserInfoConfig {
    @Bean (name = "user1")
    public UserInfo user1 () {
        UserInfo userInfo = new UserInfo(1, "zhangsan", 2);
        return userInfo;
    }

    @Primary
    @Bean
    public UserInfo user2 () {
        UserInfo userInfo = new UserInfo(2, "lisi", 3);
        return userInfo;
    }
}
